<extend name="Public:innerbase"/>
<block name="css">
<link rel="stylesheet" href="{:STATICS}/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="{:STATICS}/kindeditor/plugins/code/prettify.css" />
</block>
<!--link rel="stylesheet" href="{:STATICS}/vote/style.css" /-->
<block name="js">
<include file="Public:upload" />
<script src="{:STATICS}/kindeditor/kindeditor.js" type="text/javascript"></script>
<script src="{:STATICS}/kindeditor/lang/zh_CN.js" type="text/javascript"></script>
<script src="{:STATICS}/kindeditor/plugins/code/prettify.js" type="text/javascript"></script>
<script src="{:RES}/js/date/WdatePicker.js" type="text/javascript"></script>
<script src="{:STATICS}/vote/common.js" type="text/javascript"></script>
<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {
editor = K.create('#info', {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : true,
uploadJson : '/index.php?m=User&c=Qiniu&a=kindEditorUpload',
items : [
'source','undo','plainpaste','wordpaste','clearhtml','quickformat','selectall','fullscreen','fontname', 'fontsize','subscript','superscript','indent','outdent','|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline','hr']
});
});
</script>
</block>
<block name="content">
<div class="container-fluid">
<div class="page-header">
  <h4> 
    <if condition="$vo['type'] eq 'img' or ($type eq 'img')"> 
      图片
    <elseif condition="$vo['type'] eq 'text' or ($type eq 'text')"/>
      文本
    <else />
      微现场
	</if>-投票设置 
</h4>
<a class="btn btn-sm btn-default" href="{:U('Vote/index')}"><i class="fa fa-chevron-left"></i>&nbsp;返回</a>
</div>
<div class="msgWrap bgfc">
<form class="form" method="post" action="" enctype="multipart/form-data">
<if condition="$vo['id'] neq ''">
  <input type="hidden" name="id" value="{$vo['id']}">
</if>
<table class="table" style=" margin:0;" border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<th width="120">关键词：</th>
<td><input type="text" name="keyword" value="<if condition="$vo['keyword'] eq ''">投票<else/>{$vo.keyword}</if>" class="px" style="width:550px;"><br><span class="red">只能写一个关键词,功能面板必须开启投票</span></td>
</tr>
<tr>
<th width="120">投票标题：</th>
<td><input type="text" name="title" value="{$vo.title}" class="px" style="width:550px;"></td>
</tr>
<tr>
<th>投票图片：</th>
<td>
<input type="text" name="picurl" value="{$vo.picurl}" class="px" id="img" style="width:300px;">
<div class="btn-group" style="vertical-align:bottom;">
	<span class="btn btn-xs btn-primary" onclick="selectAsset('img',720,400)">
		<span class="glyphicon glyphicon-cloud-upload"></span>选择
	</span>
	<span class="btn btn-primary btn-xs" onclick="previewImg('img')">
		<span class="glyphicon glyphicon-picture"></span>预览
	</span>
</div>
 </td>
</tr>
<tr>
<th>图片显示：</th>
<td><label>
<input type="radio" name="showpic" value="1" checked="checked" id="showpic2">
显示在投票页面</label>
<label>
<input name="showpic" type="radio" id="showpic1" value="0">
不显示在投票页面</label>
</td>
</tr>
<tr>
<th valign="top">投票说明：</th>
<td valign="top"><textarea class="px" id="info" name="info" style="width: 560px; height: 120px; display: ;"><?php echo html_entity_decode(htmlspecialchars_decode($vo['info'])); ?></textarea></td>
</tr>
<tr>
<th valign="top">投票选项：</th>
<td valign="top"><div class="bdrcontent">
<div id="div_ptype">
<table class="table" border="0" cellspacing="0" cellpadding="0" width="100%">
<script type="text/javascript">
function addDeltbody(i) {

    //document.getElementById("div_add_del_" + i).value = "";
    //document.getElementById("svalue" + i).value = "";
    if (i != 1) {
       document.getElementById("div_add_del_" + i).style.display = "none";
       document.getElementById("add" + i).style.display = "";
    }
}
function addTabody(i) {
    document.getElementById('div_add_del_' + i).style.display = "";
    document.getElementById('add' + i).style.display = "none";
}

function delrow(obj, tbody,objid) {
  $$(tbody).removeChild(obj.parentNode.parentNode);

   var obj = {id:objid}
        $.post("{:U('Vote/del_tab')}", obj,
            function(data) {

            },
        "json");
}



  </script>
<tbody>
<tr>
    <td width="260">选项标题</td>
    <td width="50">排序</td>
    <td width="50">票数</td>
    <if condition="$vo['type'] eq 'img' OR $type eq 'img' OR ($vo['type'] eq 'scene') OR ($type eq 'scene')">
    <td width="260">图片外链地址</td>
    <td width="260">图片跳转地址以http://开头</td>
    </if>
    <td class="norightborder"></td>
</tr>
</tbody>
<if condition="$items neq ''">
<volist name="items" id="ivo">
<tbody id="div_add_del_{$i+50}" name="div_add_del">
<tr>
    <input type="hidden" name="add[id][]"   value="{$ivo.id}" style="width:20px;">
    <td width="120"><input type="text" name="add[item][]" value="{$ivo.item}" class="px" style="width:120px;"></td>
    <td width="20"><input type="text" name="add[rank][]" value="{$ivo.rank}" style="width:20px;" class="px"></td>
    <td width="20"><input type="text" name="add[vcount][]" value="{$ivo.vcount}" style="width:20px;" class="px"></td>
    <if condition="$vo['type'] eq 'img' OR $type eq 'img' OR ($vo['type'] eq 'scene') OR ($type eq 'scene')">
    <td width="200">
	<if condition="$ivo['startpicurl'] neq ''">
	<img class="thumb_img" id="startpicurl_{$i+50}_src" src="{$ivo['startpicurl']}" style="max-height:100px;display: none;">
	</if>
    <input type="text" name="add[startpicurl][]" value="{$ivo.startpicurl}" class="px" id="startpicurl_{$i+50}" style="width:130px;">
	<div class="btn-group" style="vertical-align:bottom;">
	<span class="btn btn-xs btn-primary" onclick="selectAsset('startpicurl_{$i+50}')">
		<span class="glyphicon glyphicon-cloud-upload"></span>选择
	</span>
	<span class="btn btn-primary btn-xs" onclick="previewImg('startpicurl_{$i+50}')">
		<span class="glyphicon glyphicon-picture"></span>预览
	</span>
</div>
	</td>
    <td width="260"><input type="text" name="add[tourl][]" value="{$ivo.tourl}" style="width:100px;" class="px"></td>
    </if>
    <td width="50" class="norightborder"><a href="javascript:;" onclick="delrow(this, 'div_add_del_{$i+50}',{$ivo.id});">删除</a></td>
</tr>
 </tbody>
</volist>
</if>
<tbody id="div_add_del_1" name="div_add_del">
    <tr >
     <input type="hidden" name="add[id][]" readonly="readonly" disabled="disabled"  value="" style="width:20px;" >
        <td width="120">
            <input type="text" name="add[item][]" value="" placeholder="请填写选项标题" class="px" style="width:120px;">
        </td>
        <td>
            <input type="text" name="add[rank][]" value="" style="width:20px;" class="px">
        </td>
         <td>
            <input type="text" name="add[vcount][]" value="" style="width:20px;" class="px">
        </td>
        <if condition="$vo['type'] eq 'img' OR $type eq 'img' OR ($vo['type'] eq 'scene') OR ($type eq 'scene')">
        <td width="200">
          <input type="text" name="add[startpicurl][]" placeholder="图片[http://]" value="" class="px" id="startpicurl_1" style="width:130px;">
          <div class="btn-group" style="vertical-align:bottom;">
			<span class="btn btn-xs btn-primary" onclick="selectAsset('startpicurl_1')">
				<span class="glyphicon glyphicon-cloud-upload"></span>选择
			</span>
			<span class="btn btn-primary btn-xs" onclick="previewImg('startpicurl_1')">
				<span class="glyphicon glyphicon-picture"></span>预览
			</span>
		</div>
        </td>
        <td width="100"><input type="text" name="add[tourl][]" value="" class="px" style="width:100px;"></td>
        </if>
        <td width="50" class="norightborder">
		<a href="javascript:;" onclick="addDeltbody(1)">删除</a>
        <a href="javascript:;" id="add2" onclick="addTabody(2)">添加</a></td>
    </tr>
</tbody>

<tbody id="div_add_del_2" name="div_add_del" style="display:none">
    <tr >
     <input type="hidden" name="add[id][]" readonly="readonly" disabled="disabled"  value="" style="width:20px;" >
        <td width="120">
            <input type="text" name="add[item][]" value="" placeholder="请填写选项标题" class="px" style="width:120px;">
        </td>
        <td>
            <input type="text" name="add[rank][]" value="" style="width:20px;" class="px">
        </td>
         <td>
            <input type="text" name="add[vcount][]" value="" style="width:20px;" class="px">
        </td>
        <if condition="$vo['type'] eq 'img' OR $type eq 'img' OR ($vo['type'] eq 'scene') OR ($type eq 'scene')">
        <td width="200">
          <input type="text" name="add[startpicurl][]" value="" placeholder="图片[http://]" class="px"
          onclick="document.getElementById('startpicurl_2_src').src=this.value;" id="startpicurl_2" style="width:130px;">
          <div class="btn-group" style="vertical-align:bottom;">
	<span class="btn btn-xs btn-primary" onclick="selectAsset('startpicurl_2')">
		<span class="glyphicon glyphicon-cloud-upload"></span>选择
	</span>
	<span class="btn btn-primary btn-xs" onclick="previewImg('startpicurl_2')">
		<span class="glyphicon glyphicon-picture"></span>预览
	</span>
</div>
        </td>
        <td width="100"><input type="text" name="add[tourl][]" value="" class="px" style="width:100px;"></td>
         </if>
         <td width="50" class="norightborder"><a href="javascript:;" onclick="addDeltbody(2)">删除</a>
          <a href="javascript:;" id="add3" onclick="addTabody(3)">添加</a></td>
    </tr>
</tbody>

<tbody id="div_add_del_3" name="div_add_del" style="display:none">
    <tr >
      <input type="hidden" name="add[id][]" readonly="readonly" disabled="disabled"  value="" style="width:50px;" >
        <td width="120">
            <input type="text" name="add[item][]" value="" placeholder="请填写选项标题"  class="px" style="width:120px;">
        </td>
        <td>
            <input type="text" name="add[rank][]" value="" style="width:20px;" class="px">
        </td>
         <td>
            <input type="text" name="add[vcount][]" value="" style="width:20px;" class="px">
        </td>
        <if condition="$vo['type'] eq 'img' OR $type eq 'img'">
        <td width="200">
          <input type="text" name="add[startpicurl][]" value="" placeholder="图片外链须加[http://]" class="px" id="startpicurl_3" style="width:130px;">
      <div class="btn-group" style="vertical-align:bottom;">
			<span class="btn btn-xs btn-primary" onclick="selectAsset('startpicurl_3')">
				<span class="glyphicon glyphicon-cloud-upload"></span>选择
			</span>
			<span class="btn btn-primary btn-xs" onclick="previewImg('startpicurl_3')">
				<span class="glyphicon glyphicon-picture"></span>预览
			</span>
		</div>

        </td>
        <td width="100"><input type="text" name="add[tourl][]" value="" class="px" style="width:100px;"></td>
         </if>
         <td width="50" class="norightborder"><a href="javascript:;" onclick="addDeltbody(3)">删除</a>
          <a href="javascript:;" id="add4" onclick="addTabody(4)">添加</a></td>
    </tr>
</tbody>


<tbody id="div_add_del_4" name="div_add_del" style="display:none">
    <tr >
      <input type="hidden" name="add[id][]" readonly="readonly" disabled="disabled"  value="" style="width:50px;" >
        <td width="120">
            <input type="text" name="add[item][]" placeholder="请填写选项标题" value="" class="px" style="width:120px;">
        </td>
        <td>
            <input type="text" name="add[rank][]" value="" style="width:20px;" class="px">
        </td>
         <td>
            <input type="text" name="add[vcount][]" value="" style="width:20px;" class="px">
        </td>
        <if condition="($vo['type'] eq 'img') OR ($type eq 'img')">
        <td width="200">
			<input type="text" name="add[startpicurl][]" value=""  placeholder="图片外链须加[http://]" class="px" id="startpicurl_4" style="width:130px;">
			<div class="btn-group" style="vertical-align:bottom;">
			<span class="btn btn-xs btn-primary" onclick="selectAsset('startpicurl_4')">
				<span class="glyphicon glyphicon-cloud-upload"></span>选择
			</span>
			<span class="btn btn-primary btn-xs" onclick="previewImg('startpicurl_4')">
				<span class="glyphicon glyphicon-picture"></span>预览
			</span>
		</div>

        </td>
        <td width="100"><input type="text" name="add[tourl][]" value="" class="px" style="width:100px;"></td>
        </if>
        <td width="50" class="norightborder"><a href="javascript:;" onclick="addDeltbody(4)">删除</a>
          <a href="javascript:;" id="add5" onclick="addTabody(5)">添加</a></td>
    </tr>
</tbody>


<tbody id="div_add_del_5" name="div_add_del" style="display:none">
    <tr >
     <input type="hidden" name="add[id][]" readonly="readonly" disabled="disabled"  value="" style="width:50px;" >
        <td width="120">
            <input type="text" name="add[item][]" value=""  placeholder="请填写选项标题" class="px" style="width:120px;">
        </td>
        <td>
            <input type="text" name="add[rank][]" value="" style="width:20px;" class="px">
        </td>
         <td>
            <input type="text" name="add[vcount][]" value="" style="width:20px;" class="px">
        </td>
        <if condition="($vo['type'] eq 'img') OR ($type eq 'img')">
        <td width="200">
          <input type="text" name="add[startpicurl][]" value="" placeholder="图片外链须加[http://]" class="px" id="startpicurl_5" style="width:130px;">
         <div class="btn-group" style="vertical-align:bottom;">
			<span class="btn btn-xs btn-primary" onclick="selectAsset('startpicurl_5')">
				<span class="glyphicon glyphicon-cloud-upload"></span>选择
			</span>
			<span class="btn btn-primary btn-xs" onclick="previewImg('startpicurl_5')">
				<span class="glyphicon glyphicon-picture"></span>预览
			</span>
		</div>

        </td>
        <td width="100"><input type="text" name="add[tourl][]" value="" class="px" style="width:100px;"></td>
         </if>
         <td width="50" class="norightborder"><a href="javascript:;" onclick="addDeltbody(5)">删除</a>
          <a href="javascript:;" id="add6" onclick="addTabody(6)">添加</a></td>
    </tr>
</tbody>

<tbody id="div_add_del_6" name="div_add_del" style="display:none">
    <tr >
     <input type="hidden" name="add[id][]" readonly="readonly" disabled="disabled"  value="" style="width:50px;" >
        <td width="120">
            <input type="text" name="add[item][]" value=""  placeholder="请填写选项标题" class="px" style="width:120px;">
        </td>
        <td>
            <input type="text" name="add[rank][]" value="" style="width:20px;" class="px">
        </td>
         <td>
            <input type="text" name="add[vcount][]" value="" style="width:20px;" class="px">
        </td>
        <if condition="($vo['type'] eq 'img') OR ($type eq 'img')">
        <td width="200">
          <input type="text" name="add[startpicurl][]" value="" placeholder="图片外链须加[http://]" class="px" id="startpicurl_6" style="width:130px;">
          <div class="btn-group" style="vertical-align:bottom;">
			<span class="btn btn-xs btn-primary" onclick="selectAsset('startpicurl_6')">
				<span class="glyphicon glyphicon-cloud-upload"></span>选择
			</span>
			<span class="btn btn-primary btn-xs" onclick="previewImg('startpicurl_6')">
				<span class="glyphicon glyphicon-picture"></span>预览
			</span>
		</div>
        </td>
        <td width="100"><input type="text" name="add[tourl][]" value="" class="px" style="width:100px;"></td>
         </if>
         <td width="50" class="norightborder"><a href="javascript:;" onclick="addDeltbody(6)">删除</a>
          <a href="javascript:;" id="add7" onclick="addTabody(7)">添加</a></td>
    </tr>
</tbody>

<tbody id="div_add_del_7" name="div_add_del" style="display:none">
    <tr >
     <input type="hidden" name="add[id][]" readonly="readonly" disabled="disabled"  value="" style="width:50px;" >
        <td width="120">
            <input type="text" name="add[item][]" value=""  placeholder="请填写选项标题" class="px" style="width:120px;">
        </td>
        <td>
            <input type="text" name="add[rank][]" value="" style="width:20px;" class="px">
        </td>
         <td>
            <input type="text" name="add[vcount][]" value="" style="width:20px;" class="px">
        </td>
        <if condition="($vo['type'] eq 'img') OR ($type eq 'img')">
        <td width="200">
          <input type="text" name="add[startpicurl][]" value="" placeholder="图片外链须加[http://]" class="px" id="startpicurl_7" style="width:130px;">
          <div class="btn-group" style="vertical-align:bottom;">
			<span class="btn btn-xs btn-primary" onclick="selectAsset('startpicurl_7')">
				<span class="glyphicon glyphicon-cloud-upload"></span>选择
			</span>
			<span class="btn btn-primary btn-xs" onclick="previewImg('startpicurl_7')">
				<span class="glyphicon glyphicon-picture"></span>预览
			</span>
		</div>
        </td>
        <td width="100"><input type="text" name="add[tourl][]" value="" class="px" style="width:100px;"></td>
         </if>
         <td width="50" class="norightborder"><a href="javascript:;" onclick="addDeltbody(7)">删除</a>
          <a href="javascript:;" id="add8" onclick="addTabody(8)">添加</a></td>
    </tr>
</tbody>
<tbody id="div_add_del_8" name="div_add_del" style="display:none">
    <tr >
     <input type="hidden" name="add[id][]" readonly="readonly" disabled="disabled"  value="" style="width:50px;" >
        <td width="120">
            <input type="text" name="add[item][]" value=""  placeholder="请填写选项标题" class="px" style="width:120px;">
        </td>
        <td>
            <input type="text" name="add[rank][]" value="" style="width:20px;" class="px">
        </td>
         <td>
            <input type="text" name="add[vcount][]" value="" style="width:20px;" class="px">
        </td>
        <if condition="($vo['type'] eq 'img') OR ($type eq 'img')">
        <td width="200">
          <input type="text" name="add[startpicurl][]" value="" placeholder="图片外链须加[http://]" class="px" id="startpicurl_8" style="width:130px;">
			<div class="btn-group" style="vertical-align:bottom;">
			<span class="btn btn-xs btn-primary" onclick="selectAsset('startpicurl_8')">
				<span class="glyphicon glyphicon-cloud-upload"></span>选择
			</span>
			<span class="btn btn-primary btn-xs" onclick="previewImg('startpicurl_8')">
				<span class="glyphicon glyphicon-picture"></span>预览
			</span>
		</div>

        </td>
        <td width="100"><input type="text" name="add[tourl][]" value="" class="px" style="width:100px;"></td>
         </if>
         <td width="50" class="norightborder"><a href="javascript:;" onclick="addDeltbody(8)">删除</a>
          <a href="javascript:;" id="add9" onclick="addTabody(9)">添加</a></td>
    </tr>
</tbody>
<tbody id="div_add_del_9" name="div_add_del" style="display:none">
    <tr >
     <input type="hidden" name="add[id][]" readonly="readonly" disabled="disabled"  value="" style="width:50px;" >
        <td width="120">
            <input type="text" name="add[item][]" value=""  placeholder="请填写选项标题" class="px" style="width:120px;">
        </td>
        <td>
            <input type="text" name="add[rank][]" value="" style="width:20px;" class="px">
        </td>
         <td>
            <input type="text" name="add[vcount][]" value="" style="width:20px;" class="px">
        </td>
        <if condition="($vo['type'] eq 'img') OR ($type eq 'img')">
        <td width="200">
          <input type="text" name="add[startpicurl][]" value="" placeholder="图片外链须加[http://]" class="px" id="startpicurl_9" style="width:130px;">
        <div class="btn-group" style="vertical-align:bottom;">
			<span class="btn btn-xs btn-primary" onclick="selectAsset('startpicurl_9')">
				<span class="glyphicon glyphicon-cloud-upload"></span>选择
			</span>
			<span class="btn btn-primary btn-xs" onclick="previewImg('startpicurl_9')">
				<span class="glyphicon glyphicon-picture"></span>预览
			</span>
		</div>
        </td>
        <td width="100"><input type="text" name="add[tourl][]" value="" class="px" style="width:100px;"></td>
         </if>
         <td width="50" class="norightborder"><a href="javascript:;" onclick="addDeltbody(9)">删除</a>
          <a href="javascript:;" id="add10" onclick="addTabody(10)">添加</a></td>
    </tr>
</tbody>

<tbody id="div_add_del_10" name="div_add_del" style="display:none">
    <tr >
     <input type="hidden" name="add[id][]" readonly="readonly" disabled="disabled"  value="" style="width:50px;" >
        <td width="120">
            <input type="text" name="add[item][]" value=""  placeholder="请填写选项标题" class="px" style="width:120px;">
        </td>
        <td>
            <input type="text" name="add[rank][]" value="" style="width:20px;" class="px">
        </td>
         <td>
            <input type="text" name="add[vcount][]" value="" style="width:20px;" class="px">
        </td>
        <if condition="($vo['type'] eq 'img') OR ($type eq 'img')">
        <td width="200">
          <input type="text" name="add[startpicurl][]" value="" placeholder="图片[http://]" class="px" id="startpicurl_10" style="width:130px;">
         <div class="btn-group" style="vertical-align:bottom;">
			<span class="btn btn-xs btn-primary" onclick="selectAsset('startpicurl_10')">
				<span class="glyphicon glyphicon-cloud-upload"></span>选择
			</span>
			<span class="btn btn-primary btn-xs" onclick="previewImg('startpicurl_10')">
				<span class="glyphicon glyphicon-picture"></span>预览
			</span>
		</div>
        </td>
        <td width="100"><input type="text" name="add[tourl][]" value="" class="px" style="width:100px;"></td>
         </if>
         <td width="50" class="norightborder"><a href="javascript:;" onclick="addDeltbody(10)">删除</a>
          </td>
    </tr>
</tbody>
<tbody>
        <tr>
            <td colspan="4" class="norightborder">
              排序默认为1，票数默认为0，如果是图片投票必须添加图片,图片跳转地址没有可以不填写。
        </tr>
  </tbody>
</table>
</div>
</div>
</td>
</tr>
<tr>
<th>单选/多选：</th>
<td>
  <p style="width: 120px; float: left; display: block; line-height: 32px; height: 32px;">
    <select name="cknums" class="input-medium">
      <option value="1" <if condition="$vo['cknums'] eq 1">selected</if>>单选</option>
      <option value="2" <if condition="$vo['cknums'] eq 2">selected</if>>多选</option>
    </select>

</p>
</td>
</tr>

<tr>
<th>截至时间：</th>
<td><input type="input" class="px" id="statdate" value="<if condition="$vo['statdate'] neq ''">{$vo.statdate|date="Y-m-d",###}</if>" onClick="WdatePicker()" name="statdate">
到
<input type="input" class="px" id="enddate" value="<if condition="$vo['enddate'] neq ''">{$vo.enddate|date="Y-m-d",###}</if>" name="enddate" onClick="WdatePicker()"></td>
</tr>
<!--
<tr>
<th>投票结果：</th>
<td>
<label>
<input name="display" type="radio" <if condition="$vo['display'] eq 1">checked</if>  value="1" id="RadioGroup2_1">
投票前可见</label>
<label>
<input name="display" type="radio" <if condition="$vo['display'] eq 0">checked <else/> checked</if> id="RadioGroup2_0" value="0">
投票后可见</label>
<label>
<input name="display" type="radio" <if condition="$vo['display'] eq 2">checked</if>id="RadioGroup2_2" value="2">
投票结束可见</label>

</td>
</tr>

-->
<input type="hidden" name="display" value="1">
<tr>
<th>&nbsp;</th>
<td>
<button type="submit" name="button" class="btn btn-success">保存</button>
</td>
</tr>
</tbody>
</table>
</form>
  </div>
 </div>
 </block>